Skip to content

REF: nanpercentile -> array_algos.quantile #44655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 23, 2021

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

@jreback jreback added Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Refactor Internal refactoring of code labels Nov 28, 2021
assert mask.shape == values.shape
result = [
_nanpercentile_1d(val, m, qs, na_value, interpolation=interpolation)
for (val, m) in zip(list(values), list(mask))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: While refactoring: are the list calls necessary here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wondered the same thing and don't have a good answer.

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale for this? Currently all nan* functions live in nanops.py, which is a nice pattern?

@jbrockmendel
Copy link
Member Author

What's the rationale for this? Currently all nan* functions live in nanops.py, which is a nice pattern?

these two functions are used exclusively in this file, and don't have any intra-nanops dependencies (e.g. _get_values, _wrap_results). There's nothing wrong with them being in nanops, but array_algos.quantile is better choice, and remains tightly-scoped.

@jreback jreback added this to the 1.4 milestone Dec 22, 2021
@jreback
Copy link
Contributor

jreback commented Dec 22, 2021

this is fine as it decouples the dependency structure a big. can you rebase

@jbrockmendel
Copy link
Member Author

rebased + greenish

@jreback jreback merged commit de4d74d into pandas-dev:master Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants